package czk.concrent.threadstatus;

/**
 * @Author:ChenZhangKun
 * @Date: 2020/4/28 22:53
 */
public class GetStatus {
    public static void main(String[] args) {
        Thread thread=new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println(123);
            }
        },"t1");
        // 获取当前线程状态 new
        Thread.State state = thread.getState();
        System.out.println(state);
        thread.start();
        // 再次获取线程状态 runnable
        Thread.State state1 = thread.getState();
        System.out.println(state1);
    }
}
